| X1 | X2 | X3 | X4 | X5 | X6 | |
|---|---|---|---|---|---|---|
| mean | 3.49 | 3.30 | 3.27 | 3.38 | 3.35 | 3.30 |
| sd | 0.97 | 0.98 | 0.97 | 0.98 | 0.98 | 0.99 |
| time | 0.00 | 1.00 | 2.00 | 3.00 | 4.00 | 5.00 |
Garland, E. L., Geschwind, N., Peeters, F., & Wichers, M. (2015). Mindfulness training promotes upward spirals of positive affect and cognition: multilevel and autoregressive latent trajectory modeling analyses. Frontiers in psychology, 6.
level =~ 1* bmi1 +1* bmi2 +1* bmi3 +
1* bmi4 +1* bmi5 +1* bmi6
slope =~ 0 * bmi1 + 1 * bmi2 + 2 * bmi3 +
3 * bmi4 + 4 * bmi5 + 5 * bmi6
bmi1 ~~(vare)* bmi1
bmi2 ~~(vare)* bmi2
bmi3 ~~(vare)* bmi3
bmi4 ~~(vare)* bmi4
bmi5 ~~(vare)* bmi5
bmi6 ~~(vare)* bmi6
結構めんどい…
切片のみのモデル (model=‘no’)
線形モデル (model=‘linear’)
二次曲線モデル (model=‘quadratic’)
latent basisモデル (model = ‘latent’)
library(RAMpath)
fit.all<-ramLCM(data=data,outcome=1:6, model='all')
fit.no<-ramLCM(data=data,outcome=1:6, model='no')
fit.linear<-ramLCM(data=data,outcome=1:6, model='linear')
fit.quadratic<-ramLCM(data=data,outcome=1:6, model='quadratic')
fit.latent<-ramLCM(data=data,outcome=1:6, model='latent')
lavaanコード
cat(fit.all$model$no)
## level =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## X1 ~~(vare)* X1
## X2 ~~(vare)* X2
## X3 ~~(vare)* X3
## X4 ~~(vare)* X4
## X5 ~~(vare)* X5
## X6 ~~(vare)* X6
lavaanコード
cat(fit.all$model$linear)
## level =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## slope =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## X1 ~~(vare)* X1
## X2 ~~(vare)* X2
## X3 ~~(vare)* X3
## X4 ~~(vare)* X4
## X5 ~~(vare)* X5
## X6 ~~(vare)* X6
lavaanコード
cat(fit.all$model$quadratic)
## level =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## slope =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## quadratic =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
## X1 ~~(vare)* X1
## X2 ~~(vare)* X2
## X3 ~~(vare)* X3
## X4 ~~(vare)* X4
## X5 ~~(vare)* X5
## X6 ~~(vare)* X6
lavaanコード
cat(fit.all$model$latent)
## level =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## slope =~ 0 * X1 +start( 1 )* X2 +start( 2 )* X3 +start( 3 )* X4 +start( 4 )* X5 + 5 * X6
## X1 ~~(vare)* X1
## X2 ~~(vare)* X2
## X3 ~~(vare)* X3
## X4 ~~(vare)* X4
## X5 ~~(vare)* X5
## X6 ~~(vare)* X6
modelXlat<-'
level =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
slope =~ 0 * X1 +start( 1 )* X2 +start( 2 )* X3 +start( 3 )* X4 +start( 4 )* X5 + 5 * X6
X1 ~~(vare)* X1
X2 ~~(vare)* X2
X3 ~~(vare)* X3
X4 ~~(vare)* X4
X5 ~~(vare)* X5
X6 ~~(vare)* X6
'
Xlat<-lavaan::growth(modelXlat,data)
Xlat.fit<-round(fitmeasures(Xlat)[c("chisq","df","pvalue","cfi","srmr","rmsea","aic","bic")],digits=2)
source("script/plot.growth.R")
a<-plot.growth(fit.all, type="no")+theme_bw()
b<-plot.growth(fit.all, type="lin")+theme_bw()
c<-plot.growth(fit.all, type="quad")+theme_bw()
d<-plot.growth(fit.all, type="latent")+theme_bw()
fits<-round(fit.all$fit[
c("chisq","df","pvalue","cfi",
"srmr","rmsea","aic","bic"),],digits=2)
fits[,2]<-Xlat.fit
datatable(fits,option=list(dom='t'))
parm<-parameterEstimates(fit.all$lavaan$quadratic)
parm[,5:10]<-round(parm[,5:10],digits=3)
datatable(parm[c(28:30,37:39),],
extensions = 'Scroller',
options = list(dom= ' t',
deferRender = TRUE,
scrollY = 200,
scroller = TRUE))
source("script/plot.growth.R")
g<-plot.growth(fit.all, type="quad")
g+ylim(3,4)+theme_bw()
model1 <-'
#切片因子の設定
i =~ 1*X1 + 1*X2 + 1*X3 +
1*X4 + 1*X5 + 1*X6
#傾き因子の設定
s1 =~ 0*X1 + 1*X2 + 2*X3 +
3*X4 + 3*X5 + 3*X6
s2 =~ 0*X1 + 0*X2 + 0*X3 +
0*X4 + 1*X5 + 2*X6
#切片と傾きの分散
i ~~ i ; s1 ~~ s1 ; s2 ~~ s2;
#因子間相関
i ~~ s1 + s2; s1 ~~ s2
#因子平均
i ~ 1 ; s1 ~ 1 ; s2 ~ 1
#誤差分散
X1 ~ 0; X2 ~ 0; X3 ~ 0
X4 ~ 0; X5 ~ 0; X6 ~ 0
'
#lavaan code
i =~ 1*t1+1*t2+1*t3+1*t4+1*t5
前半の傾き(s1)の因子負荷を
区分時点以降同値に固定
#lavaan model code
i=~0*t1+1*t2+2*t3+3*t4+3*t5+3*t6
後半の傾き(s1)の因子負荷を
区分時点まで0に固定
#lavaan model code
i=~0*t1+0*t2+0*t3+0*t4+1*t5+2*t6
#切片と傾きの分散
i ~~ i ; s1 ~~ s1 ; s2 ~~ s2
#因子間相関
i ~~ s1 + s2 ; s1 ~~ s2
#因子平均
i ~ 1 ; s1 ~ 1 ; s2 ~ 1
#誤差分散
bmi1 ~ 0; bmi2 ~ 0; bmi3 ~ 0
bmi4 ~ 0; bmi5 ~ 0; bmi6 ~ 0
library(lavaan)
model1.fit<-lavaan::growth(model1, data)
fit1.m<-round(fitMeasures(model1)[c("chisq","df","pvalue",
"cfi","srmr","rmsea")],digits=2)
fit1.m<-t(as.data.frame(fit1))
print(xtable(fit1.m),comment=F,type="html")
piecewise
quadratic
傾き因子の平均に等値制約を置いたモデルと比較
#傾き因子平均が等値
s1 ~ (a)*1 ; s2 ~ (a)*1# model1.2fit = 等値制約のモデル
anova(model1.2fit, model1.fit)
## Chi Square Difference Test
##
## Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq)
## model1.fit 12 26252 26336 324.30
## model1.2fit 13 26251 26330 325.46 1.1551 1 0.2825
今回のモデルでは期間による傾きの違いは認められない
model2 <-'
#切片因子の設定
i =~ 1*X1 + 1*X2 + 1*X3 + 1*X4 + 1*X5 + 1*X6
#傾き因子の設定
s1 =~ 0*X1 + 1*X2 + 2*X3 +3*X4 + 3*X5 + 3*X6
s2 =~ 0*X1 + 1*X2 + 4*X3 +9*X4 + 9*X5 + 9*X6
s3 =~ 0*X1 + 0*X2 + 0*X3 +0*X4 + 1*X5 + 2*X6
#切片と傾きの分散
i ~~ i ; s1 ~~ s1 ; s2 ~~ s2; s3 ~~ s3;
#因子間相関
i ~~ s1 + s2 + s3; s1 ~~ s2 + s3 ; s2 ~~ s3 ;
#因子平均
i ~ 1 ; s1 ~ 1 ; s2 ~ 1 ; s3 ~ 1
#誤差分散
X1 ~ 0; X2 ~ 0; X3 ~ 0; X4 ~ 0; X5 ~ 0; X6 ~ 0
'
model2.fit<-lavaan::growth(model2, data=data)
fit2.m<-round(fitMeasures(model2.fit)
[c("chisq","df","pvalue",
"cfi","srmr","rmsea")],digits=2)
fit2.m<-t(as.data.frame(fit2.m))
datatable(fit2.m,options=list(dom="t"))
圧倒的なfit感!!
model2.2 <-'
i1 =~ 1*X1 + 1*X2 + 1*X3 + 0*X4 + 0*X5 + 0*X6
i2 =~ 0*X1 + 0*X2 + 0*X3 + 1*X4 + 1*X5 + 1*X6
s1 =~ 0*X1 + 1*X2 + 2*X3 + 3*X4 + 3*X5 + 3*X6
s2 =~ 0*X1 + 0*X2 + 0*X3 + 0*X4 + 1*X5 + 2*X6
i1 ~~ i1
i2 ~~ i2
s1 ~~ s1
s2 ~~ s2
i1 ~~ i2 + s1 + s2
i2 ~~ s1 + s2
s1 ~~ s2
i1 ~ 1
i2 ~ 1
s1 ~ 1
s2 ~ 1
X1 ~ 0
X2 ~ 0
X3 ~ 0
X4 ~ 0
X5 ~ 0
X6 ~ 0 '
Garland, E. L., Geschwind, N., Peeters, F., & Wichers, M. (2015). Mindfulness training promotes upward spirals of positive affect and cognition: multilevel and autoregressive latent trajectory modeling analyses. Frontiers in psychology, 6.
parallel<-'
# posi感情のモデル (2次)
level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
slope.X =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
quadratic.X =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
# posi認知のモデル (切片のみ)
level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
'
para<-lavaan::growth(parallel, data)
round(fitmeasures(para)[
c("chisq","df","pvalue","cfi",
"srmr","rmsea","aic","bic")],digits=2)
## chisq df pvalue cfi srmr rmsea aic bic
## 9764.86 64.00 0.00 0.55 0.10 0.28 55467.84 55613.46
parameterEstimates(para,standardized=T)[41:46,c(1:3,11,7)]
## lhs op rhs std.all pvalue
## 41 level.X ~~ slope.X -0.404 0.000
## 42 level.X ~~ quadratic.X 0.388 0.000
## 43 level.X ~~ level.Y 0.716 0.000
## 44 slope.X ~~ quadratic.X -0.990 0.000
## 45 slope.X ~~ level.Y 0.126 0.000
## 46 quadratic.X ~~ level.Y -0.086 0.022
parallel2<-'
# posi感情のモデル (2次)
level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
# posi認知のモデル (切片のみ)
level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
X1 ~~ Y1
X2 ~~ Y2
X3 ~~ Y3
X4 ~~ Y4
X5 ~~ Y5
X6 ~~ Y6
'
para2<-lavaan::growth(parallel2, data)
round(fitmeasures(para2)[
c("chisq","df","pvalue","cfi",
"srmr","rmsea","aic","bic")],digits=2)
## chisq df pvalue cfi srmr rmsea aic bic
## 1939.44 67.00 0.00 0.91 0.07 0.12 47636.42 47765.24
summary(para2, standardized=T, fit.measures=T)
## lavaan (0.5-20) converged normally after 60 iterations
##
## Number of observations 2000
##
## Estimator ML
## Minimum Function Test Statistic 1939.444
## Degrees of freedom 67
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 21599.301
## Degrees of freedom 66
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.913
## Tucker-Lewis Index (TLI) 0.914
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -23795.210
## Loglikelihood unrestricted model (H1) -22825.488
##
## Number of free parameters 23
## Akaike (AIC) 47636.421
## Bayesian (BIC) 47765.241
## Sample-size adjusted Bayesian (BIC) 47692.169
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.118
## 90 Percent Confidence Interval 0.114 0.123
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.073
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## level.X =~
## X1 1.000 0.782 0.759
## X2 1.000 0.782 0.770
## X3 1.000 0.782 0.816
## X4 1.000 0.782 0.804
## X5 1.000 0.782 0.838
## X6 1.000 0.782 0.770
## level.Y =~
## Y1 1.000 0.627 0.624
## Y2 1.000 0.627 0.632
## Y3 1.000 0.627 0.627
## Y4 1.000 0.627 0.647
## Y5 1.000 0.627 0.647
## Y6 1.000 0.627 0.619
##
## Covariances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 ~~
## Y1 0.368 0.016 22.518 0.000 0.368 0.699
## X2 ~~
## Y2 0.363 0.016 23.033 0.000 0.363 0.730
## X3 ~~
## Y3 0.314 0.014 22.434 0.000 0.314 0.729
## X4 ~~
## Y4 0.338 0.014 23.793 0.000 0.338 0.792
## X5 ~~
## Y5 0.270 0.013 21.552 0.000 0.270 0.716
## X6 ~~
## Y6 0.414 0.017 24.729 0.000 0.414 0.804
## level.X ~~
## level.Y 0.380 0.016 23.588 0.000 0.776 0.776
##
## Intercepts:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 0.000 0.000 0.000
## X2 0.000 0.000 0.000
## X3 0.000 0.000 0.000
## X4 0.000 0.000 0.000
## X5 0.000 0.000 0.000
## X6 0.000 0.000 0.000
## Y1 0.000 0.000 0.000
## Y2 0.000 0.000 0.000
## Y3 0.000 0.000 0.000
## Y4 0.000 0.000 0.000
## Y5 0.000 0.000 0.000
## Y6 0.000 0.000 0.000
## level.X 3.340 0.018 182.521 0.000 4.270 4.270
## level.Y 3.354 0.016 214.450 0.000 5.352 5.352
##
## Variances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 0.450 0.016 27.967 0.000 0.450 0.424
## X2 0.419 0.015 27.700 0.000 0.419 0.406
## X3 0.306 0.012 26.214 0.000 0.306 0.333
## X4 0.335 0.013 26.675 0.000 0.335 0.354
## X5 0.260 0.010 25.234 0.000 0.260 0.298
## X6 0.420 0.015 27.702 0.000 0.420 0.407
## Y1 0.617 0.022 27.770 0.000 0.617 0.611
## Y2 0.591 0.021 27.595 0.000 0.591 0.601
## Y3 0.607 0.022 27.680 0.000 0.607 0.607
## Y4 0.546 0.020 27.260 0.000 0.546 0.582
## Y5 0.545 0.020 27.209 0.000 0.545 0.581
## Y6 0.632 0.023 27.856 0.000 0.632 0.617
## level.X 0.612 0.021 28.862 0.000 1.000 1.000
## level.Y 0.393 0.016 25.282 0.000 1.000 1.000
-変数の安定性
source('script/bivALTM.R')
cat(ALTM)
##
## # posi感情のモデル
## level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## #slope.X =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## #quadratic.X =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
##
##
## # posi認知のモデル
## level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
##
##
## # 自己回帰のモデル
## X2 ~ X1
## X3 ~ X2
## X4 ~ X3
## X5 ~ X4
## X6 ~ X5
##
## Y2 ~ Y1
## Y3 ~ Y2
## Y4 ~ Y3
## Y5 ~ Y4
## Y6 ~ Y5
##
## #交差遅延モデル
## Y2 ~ X1
## Y3 ~ X2
## Y4 ~ X3
## Y5 ~ X4
## Y6 ~ X5
##
## X2 ~ Y1
## X3 ~ Y2
## X4 ~ Y3
## X5 ~ Y4
## X6 ~ Y5
##
## # 同時点の残差相関
## X1 ~~ Y1
## X2 ~~ Y2
## X3 ~~ Y3
## X4 ~~ Y4
## X5 ~~ Y5
## X6 ~~ Y6
summary(AL<-growth(ALTM, data), standardized=T, fit.measures=T)
## lavaan (0.5-20) converged normally after 97 iterations
##
## Number of observations 2000
##
## Estimator ML
## Minimum Function Test Statistic 1730.744
## Degrees of freedom 47
## P-value (Chi-square) 0.000
##
## Model test baseline model:
##
## Minimum Function Test Statistic 21599.301
## Degrees of freedom 66
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.922
## Tucker-Lewis Index (TLI) 0.890
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -23690.861
## Loglikelihood unrestricted model (H1) -22825.488
##
## Number of free parameters 43
## Akaike (AIC) 47467.721
## Bayesian (BIC) 47708.560
## Sample-size adjusted Bayesian (BIC) 47571.947
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.134
## 90 Percent Confidence Interval 0.128 0.139
## P-value RMSEA <= 0.05 0.000
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.064
##
## Parameter Estimates:
##
## Information Expected
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## level.X =~
## X1 1.000 0.795 0.769
## X2 1.000 0.795 0.770
## X3 1.000 0.795 0.846
## X4 1.000 0.795 0.821
## X5 1.000 0.795 0.832
## X6 1.000 0.795 0.808
## level.Y =~
## Y1 1.000 0.631 0.631
## Y2 1.000 0.631 0.643
## Y3 1.000 0.631 0.633
## Y4 1.000 0.631 0.647
## Y5 1.000 0.631 0.645
## Y6 1.000 0.631 0.625
##
## Regressions:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X2 ~
## X1 0.074 0.021 3.480 0.001 0.074 0.074
## X3 ~
## X2 -0.056 0.020 -2.856 0.004 -0.056 -0.062
## X4 ~
## X3 -0.072 0.021 -3.454 0.001 -0.072 -0.070
## X5 ~
## X4 0.049 0.021 2.383 0.017 0.049 0.050
## X6 ~
## X5 -0.147 0.023 -6.248 0.000 -0.147 -0.143
## Y2 ~
## Y1 -0.108 0.026 -4.191 0.000 -0.108 -0.110
## Y3 ~
## Y2 0.027 0.027 0.988 0.323 0.027 0.027
## Y4 ~
## Y3 0.066 0.026 2.552 0.011 0.066 0.068
## Y5 ~
## Y4 -0.088 0.029 -3.083 0.002 -0.088 -0.088
## Y6 ~
## Y5 0.167 0.028 5.921 0.000 0.167 0.162
## Y2 ~
## X1 0.080 0.026 3.130 0.002 0.080 0.085
## Y3 ~
## X2 -0.046 0.027 -1.706 0.088 -0.046 -0.048
## Y4 ~
## X3 -0.054 0.026 -2.043 0.041 -0.054 -0.052
## Y5 ~
## X4 0.112 0.029 3.873 0.000 0.112 0.111
## Y6 ~
## X5 -0.187 0.029 -6.472 0.000 -0.187 -0.177
## X2 ~
## Y1 -0.096 0.021 -4.542 0.000 -0.096 -0.093
## X3 ~
## Y2 0.029 0.020 1.462 0.144 0.029 0.030
## X4 ~
## Y3 0.075 0.020 3.709 0.000 0.075 0.078
## X5 ~
## Y4 -0.048 0.020 -2.371 0.018 -0.048 -0.049
## X6 ~
## Y5 0.122 0.023 5.341 0.000 0.122 0.121
##
## Covariances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 ~~
## Y1 0.357 0.016 22.365 0.000 0.357 0.696
## X2 ~~
## Y2 0.355 0.016 22.852 0.000 0.355 0.726
## X3 ~~
## Y3 0.312 0.014 22.371 0.000 0.312 0.732
## X4 ~~
## Y4 0.335 0.014 23.679 0.000 0.335 0.792
## X5 ~~
## Y5 0.263 0.012 21.329 0.000 0.263 0.711
## X6 ~~
## Y6 0.402 0.016 24.614 0.000 0.402 0.800
## level.X ~~
## level.Y 0.389 0.017 22.698 0.000 0.777 0.777
##
## Intercepts:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 0.000 0.000 0.000
## X2 0.000 0.000 0.000
## X3 0.000 0.000 0.000
## X4 0.000 0.000 0.000
## X5 0.000 0.000 0.000
## X6 0.000 0.000 0.000
## Y1 0.000 0.000 0.000
## Y2 0.000 0.000 0.000
## Y3 0.000 0.000 0.000
## Y4 0.000 0.000 0.000
## Y5 0.000 0.000 0.000
## Y6 0.000 0.000 0.000
## level.X 3.377 0.022 150.667 0.000 4.250 4.250
## level.Y 3.368 0.021 156.873 0.000 5.338 5.338
##
## Variances:
## Estimate Std.Err Z-value P(>|z|) Std.lv Std.all
## X1 0.438 0.016 27.876 0.000 0.438 0.409
## X2 0.411 0.015 27.613 0.000 0.411 0.386
## X3 0.299 0.011 26.099 0.000 0.299 0.339
## X4 0.333 0.013 26.645 0.000 0.333 0.356
## X5 0.255 0.010 25.179 0.000 0.255 0.280
## X6 0.411 0.015 27.673 0.000 0.411 0.426
## Y1 0.600 0.022 27.535 0.000 0.600 0.601
## Y2 0.581 0.021 27.393 0.000 0.581 0.604
## Y3 0.608 0.022 27.482 0.000 0.608 0.612
## Y4 0.539 0.020 27.024 0.000 0.539 0.567
## Y5 0.537 0.020 26.946 0.000 0.537 0.561
## Y6 0.614 0.022 27.792 0.000 0.614 0.603
## level.X 0.632 0.023 27.611 0.000 1.000 1.000
## level.Y 0.398 0.016 24.501 0.000 1.000 1.000
cat(ALTM2)
##
## # posi感情のモデル
## level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## #slope.X =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## #quadratic.X =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
##
##
## # posi認知のモデル
## level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
##
##
## # 自己回帰のモデル
## X2 ~ (a)*X1
## X3 ~ (a)*X2
## X4 ~ (a)*X3
## X5 ~ (a)*X4
## X6 ~ (a)*X5
##
## Y2 ~ (b)*Y1
## Y3 ~ (b)*Y2
## Y4 ~ (b)*Y3
## Y5 ~ (b)*Y4
## Y6 ~ (b)*Y5
##
## #交差遅延モデル
## Y2 ~ (c)*X1
## Y3 ~ (c)*X2
## Y4 ~ (c)*X3
## Y5 ~ (c)*X4
## Y6 ~ (c)*X5
##
## X2 ~ (d)*Y1
## X3 ~ (d)*Y2
## X4 ~ (d)*Y3
## X5 ~ (d)*Y4
## X6 ~ (d)*Y5
##
## # 同時点の残差相関
## X1 ~~ Y1
## X2 ~~ Y2
## X3 ~~ Y3
## X4 ~~ Y4
## X5 ~~ Y5
## X6 ~~ Y6
cat(ALTM3)
##
## # posi感情のモデル
## level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## #slope.X =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## #quadratic.X =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
##
##
## # posi認知のモデル
## level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
##
##
## # 自己回帰のモデル
## X2 ~ (a)*X1
## X3 ~ (a)*X2
## X4 ~ (a)*X3
## X5 ~ (a)*X4
## X6 ~ (a)*X5
##
## Y2 ~ (b)*Y1
## Y3 ~ (b)*Y2
## Y4 ~ (b)*Y3
## Y5 ~ (b)*Y4
## Y6 ~ (b)*Y5
##
## #交差遅延モデル
## Y2 ~ X1
## Y3 ~ X2
## Y4 ~ X3
## Y5 ~ X4
## Y6 ~ X5
##
## X2 ~ Y1
## X3 ~ Y2
## X4 ~ Y3
## X5 ~ Y4
## X6 ~ Y5
##
## # 同時点の残差相関
## X1 ~~ Y1
## X2 ~~ Y2
## X3 ~~ Y3
## X4 ~~ Y4
## X5 ~~ Y5
## X6 ~~ Y6
cat(ALTM4)
##
## # posi感情のモデル
## level.X =~ 1* X1 +1* X2 +1* X3 +1* X4 +1* X5 +1* X6
## #slope.X =~ 0 * X1 + 1 * X2 + 2 * X3 + 3 * X4 + 4 * X5 + 5 * X6
## #quadratic.X =~ 0 * X1 + 1 * X2 + 4 * X3 + 9 * X4 + 16 * X5 + 25 * X6
##
##
## # posi認知のモデル
## level.Y =~ 1* Y1 +1* Y2 +1* Y3 +1* Y4 +1* Y5 +1* Y6
##
##
## # 自己回帰のモデル
## #X2 ~ (a)*X1
## #X3 ~ (a)*X2
## #X4 ~ (a)*X3
## #X5 ~ (a)*X4
## #X6 ~ (a)*X5
##
## #Y2 ~ (b)*Y1
## #Y3 ~ (b)*Y2
## #Y4 ~ (b)*Y3
## #Y5 ~ (b)*Y4
## #Y6 ~ (b)*Y5
##
## #交差遅延モデル
## Y2 ~ X1
## Y3 ~ X2
## Y4 ~ X3
## Y5 ~ X4
## Y6 ~ X5
##
## X2 ~ Y1
## X3 ~ Y2
## X4 ~ Y3
## X5 ~ Y4
## X6 ~ Y5
##
## # 同時点の残差相関
## X1 ~~ Y1
## X2 ~~ Y2
## X3 ~~ Y3
## X4 ~~ Y4
## X5 ~~ Y5
## X6 ~~ Y6
AL2<-growth(ALTM2, data); AL3<-growth(ALTM3, data); AL4<-growth(ALTM4, data)
library(semTools)
compareFit(para2,AL,AL2, AL3,AL4)
## ################### Nested Model Comparison #########################
## chi df p delta.cfi
## AL - AL3 92.06 8 <.001 0.0039
## AL3 - AL4 5.05 2 .080 0.0001
## AL4 - AL2 98.82 6 <.001 0.0043
## AL2 - para2 12.77 4 .012 0.0004
##
## #################### Fit Indices Summaries ##########################
## chisq df pvalue cfi tli aic bic rmsea
## para2 1939.444 67 .000† .913 .914† 47636.421 47765.241 .118†
## AL 1730.744 47 .000† .922† .890 47467.721† 47708.560† .134
## AL2 1926.676 63 .000† .913 .909 47631.653 47782.877 .122
## AL3 1822.808 55 .000† .918 .901 47543.785 47739.816 .127
## AL4 1827.858 57 .000† .918 .905 47544.835 47729.665 .125
## srmr
## para2 .073
## AL .064†
## AL2 .073
## AL3 .068
## AL4 .068
Curran, Patrick J., et al. “The separation of between-person and within-person components of individual change over time: A latent curve model with structured residuals.” Journal of consulting and clinical psychology 82.5 (2014): 879.